<?php 
/* SVN FILE: $Id$ */
/* Attribute Test cases generated on: 2009-05-30 14:05:42 : 1243707042*/
App::import('Model', 'Attribute');

class AttributeTestCase extends CakeTestCase {
	var $Attribute = null;
	var $fixtures = array('app.attribute', 'app.goods_type', 'app.category', 'app.goods_attr');

	function startTest() {
		$this->Attribute =& ClassRegistry::init('Attribute');
	}

	function testAttributeInstance() {
		$this->assertTrue(is_a($this->Attribute, 'Attribute'));
	}

	function testAttributeFind() {
		$this->Attribute->recursive = -1;
		$results = $this->Attribute->find('first');
		$this->assertTrue(!empty($results));

		$expected = array('Attribute' => array(
			'id'  => 1,
			'attr_name'  => 'Lorem ipsum dolor sit amet',
			'attr_input_type'  => 1,
			'attr_type'  => 1,
			'attr_values'  => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida,phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam,vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit,feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
			'attr_index'  => 1,
			'sort_order'  => 1,
			'is_linked'  => 'Lorem ipsum dolor sit amet, aliquet feugiat. Convallis morbi fringilla gravida,phasellus feugiat dapibus velit nunc, pulvinar eget sollicitudin venenatis cum nullam,vivamus ut a sed, mollitia lectus. Nulla vestibulum massa neque ut et, id hendrerit sit,feugiat in taciti enim proin nibh, tempor dignissim, rhoncus duis vestibulum nunc mattis convallis.',
			'attr_group'  => 1,
			'goods_type_id'  => 1
		));
		$this->assertEqual($results, $expected);
	}
}
?>